<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <!-- 引入 ECharts 文件 -->
    <script src="echarts.min.js"></script>
    <title>Document</title>
    
</head>
<body>
    <!-- 为ECharts准备一个具备大小（宽高）的Dom -->
    <div id="main" style="width: 600px;height:400px;"></div>

    <script>
        // 基于准备好的dom，初始化echarts实例
        var myChart = echarts.init(document.getElementById('main'));

        // 指定图表的配置项和数据
        var option = {
            title: {
                link: 'https://www.baidu.com/',
                subtext: '副标题xx',
                left: 'left',
                textStyle: {
                    color: 'red'
                },
                text: 'ECharts 入门示例1111'
            },
            tooltip: {
                formatter: '<h2>{a0}</h2><div style="color: red;" >{b0}: {c0}</div>',
                show: true // 不显示提示框
            },
            legend: {
                // data:['销量', "库存"]
            },
            xAxis: {
                name: "商品",
                data: ["衬衫","羊毛衫","雪纺衫","裤子","高跟鞋","袜子","裙子","围巾"]
            },
            yAxis: {
                name: "值"
            },
            series: [
                {
                    name: '销量',
                    type: 'bar',
                    data: [5, 20, 36, 10, 10, 20, 100, 500]
                },
                {
                    name: '库存',
                    type: 'line',
                    data: [15, 10, 26, 30, 50, 10, 80, 100]
                }
            ]
        };

        // 使用刚指定的配置项和数据显示图表。
        myChart.setOption(option);
    </script>
</body>
</html>